package com.xiaofeng.pochi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaofeng.pochi.pojo.ShopUserAddress;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/09/14/21:21
 * @Description:
 */
@Component
public interface ShopUserAddressMapper extends BaseMapper<ShopUserAddress> {

    /**
     * 添加
     * @param shopUserAddress
     */
    void save(ShopUserAddress shopUserAddress);

    /**
     * 根据用户ID将该用户所有的收货地址修改为非默认地址
     * @param id
     */
    void updateNotDefaultByUserId(Long id);

    /**
     * 修改地址
     * */
    void update(ShopUserAddress shopUserAddress);


    /**
     * 查询
     * */
    ShopUserAddress get(Long id);

    /**
     * 删除
     * */
    void delete(Long id);

    /**
     * 根据用户id查询地址列表
     * */
    List<ShopUserAddress> getByUserId(Long userId);
}
